﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Heightmap_Editor.Menu.Screens
{
    class MenuWidget
    {
        #region Fields

        private string text;
        #endregion

        #region Properties

        public string Text
        {
            get { return text; }
            set { text = value; }
        }

        #endregion

        public MenuWidget(string text)
        {
            this.text = text;
        }

        public virtual void Update(MenuScreen screen, GameTime gameTime)
        { }

        public virtual void Draw(MenuScreen screen, Vector2 position, GameTime gameTime)
        {
            SpriteBatch batch = screen.ScreenManager.SpriteBatch;
            SpriteFont font = screen.ScreenManager.Font;

            batch.DrawString(font, text, position, Color.White);
        }

        /// <summary>
        /// Queries how much space this menu entry requires.
        /// </summary>
        public virtual int GetHeight(MenuScreen screen)
        {
            return screen.ScreenManager.Font.LineSpacing;
        }
    }
}
